<#include "header.htm"/>
<#import "../macros/pagination.ftl" as pagination/>
<#import "../macros/presentation.ftl" as presentation/>

<script type="text/javascript" src="${contextPath}/templates/${templateName}/js/post_show.js?${startupTime}"></script>
<script type="text/javascript" src="${contextPath}/templates/${templateName}/js/post.js?${startupTime}"></script>
<script type="text/javascript" src="${contextPath}/templates/${templateName}/js/pagination.js?${startupTime}"></script>
<script type="text/javascript">
<!--
<#include "js/karma.js">
<#include "js/utils.js">
-->
</script>

<div id="page-body">

<h2>
   <a href="${JForumContext.encodeURL("/posts/listByUser/${u.id}")}">${I18n.getMessage("PostShow.userPosts")}: ${u.username?html}</a>
</h2>

<div class="topic-actions" >

	
   		<div class="pagination">
			<#assign paginationData>	
				<@pagination.doPagination "listByUser", u.id/>
			</#assign>
				${paginationData}
		</div>
		

	</div>

				<!-- POST LISTING --> 
				<#assign rowColor = ""/>
				<#list posts as post>
					<#if post_index % 2 == 0>
						<#assign rowColor = "bg2">
					<#else>
						<#assign rowColor = "bg1">
					</#if>
	
					<#assign topic = topics.get(post.topicId) />
					<#assign forum = forums.get(post.forumId) />

					
					<div class="search post ${rowColor}">
		            	<div class="inner"><span class="corners-top"><span></span></span>
		            	<div class="postbody">
		            			<h3><a href="${JForumContext.encodeURL("/posts/preList/${post.topicId}/${post.id}${extension}#${post.id}", "")}">${topic.title?default("Empty")?html}</a></h3>
		            			<div class="content">${post.text}</div>
		            			<!-- Attachments -->
							<#if post.hasAttachments() && (canDownloadAttachments || attachmentsEnabled)>
								<#assign attachments = am.getAttachments(post.id, post.forumId)/>
							</#if>
		           		</div>
		           		<dl class="postprofile">
		           		                               
		           			<dt class="author">${I18n.getMessage("by")}&nbsp;<a href="${JForumContext.encodeURL("/user/profile/${u.username?html}")}" style="color: #AA0000;" class="username-coloured">${u.username?html}</a></dt>
		           			<dd>${post.formatedTime}</dd>
		           			<dd>&nbsp;</dd>
		           			<dd>${I18n.getMessage("PostShow.forum")}: <a href="${JForumContext.encodeURL("/forums/show/${forum.id}")}">${forum.name?html}</a></dd>
		           			<dd>${I18n.getMessage("PostShow.topic")}: <a href="${JForumContext.encodeURL("/posts/list/${topic.id}")}">
		           				<#if (topic.title?length == 0)>
		           					No Subject
		           				<#else>
		           					${topic.title?html}
		           				</#if>
		           			
		           			</a></dd>
		           			<dd>${I18n.getMessage("ForumIndex.replies")}: <strong>${topic.totalReplies}</strong></dd>
		           			<dd>${I18n.getMessage("ForumIndex.views")}: <strong>${topic.totalViews}</strong></dd>
		           			<dd><script type="text/javascript">writeStars(${post.karma.karmaPoints}, ${post.id});</script></dd>
	
		           		</dl>
		           		<ul class="searchresults">
		           			<li><a href="${JForumContext.encodeURL("/posts/preList/${post.topicId}/${post.id}${extension}#${post.id}", "")}" class="right">${I18n.getMessage("PostShow.jumpToPost")}</a></li>
		           		</ul>
		           		<span class="corners-bottom"><span></span></span>
		           		</div>
		           	</div>
					
				</#list>
				<!-- END OF POST LISTING -->

    <div class="topic-actions" >

	
   		<div class="pagination">
            ${paginationData}
		</div>
		

	</div>	
	
	<@presentation.forumsComboTable/>

</div>




<#include "bottom.htm"/>
